import 'package:eh_mobile/common/utils/extension.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';

class CommonControlUtils {
  static Widget percentView(String svgName, double brightnessValue,{int textFontSize=16,int textPercentSize=12,}) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.start,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        SizedBox(
          width: 22.r,
          height: 22.r,
          child: SvgPicture.asset(
            svgName,
            colorFilter: const ColorFilter.mode(
                Color.fromRGBO(168, 168, 168, 1), BlendMode.srcIn),
          ),
        ),
        4.sizedBoxWidth,
        Text(
          '${(brightnessValue * 100).round()}',
          style: textFontSize.ts.copyWith(color: const Color.fromRGBO(222, 222, 222, 1)),
        ),
        2.sizedBoxWidth,
        Text(
          '%',
          style: textPercentSize.ts.copyWith(color: const Color.fromRGBO(168, 168, 168, 1)),
        )
      ],
    );
  }
}
